package com.epoint.spring.job;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

/**
 * 这是springboot自带的定时器
 */
@Slf4j
//@Component
//@Async
public class TestJob2 {

//    @Scheduled(cron = "0/5 * * * * ?")
    public void job1() throws InterruptedException {
        log.info("当前TestJob2开始执行~~~" + Thread.currentThread().getName());

        TimeUnit.SECONDS.sleep(6);

        log.info("--------------------------------------" + Thread.currentThread().getName());
    }


}
